<?php
include_once("functions/db_manipulate.php");

if (!init()) {
  redirect("?action=login");
  exit();
}

?>

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Админская часть сайта</title>
  <link rel="stylesheet" type="text/css" href="css/general.css">
  <script src="../resources/jquery.js"></script>

  <meta charset="UTF-8">
</head>

<body>
<?php
include_once("menu.php");
?>

<div class="contentdiv">
  <div class="usersmenu">
    <div class="usermenubutton" onclick="location.href='?action=index&block=all'">
      Все пользователи
    </div>
    <div class="usermenubutton" onclick="location.href='?action=index&block=del'">
      Ожидающие удаления
    </div>
    <div class="usermenubutton" onclick="location.href='?action=index&block=block'">
      Заблокированные
    </div>
    <div class="usermenubutton" onclick="location.href='?action=index&block=search'">
      Поиск по имени
    </div>
  </div>


  <?php
  if (isset($_GET['block'])) {
    switch ($_GET['block']) {
      case "all":
        include_once("allusers.php");
        break;
      case "del":
        include_once("delusers.php");
        break;
      case "block":
        include_once("blockedusers.php");
        break;
      case "search":
        include_once("search_users.php");
        break;
      default:
        include_once("allusers.php");
        break;
    }
  } else {
    include_once("allusers.php");
  }

  ?>
</div>
</body>
</html>